package com.project;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.Toast;

public class ProjectActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
    @Override
    public boolean onCreateOptionsMenu(Menu menu)
    {
    	MenuInflater menuInflater = getMenuInflater();
    	menuInflater.inflate(R.menu.menu1, menu);
    	return true;
    }
    @Override
    public boolean onOptionsItemSelected(MenuItem item)
    	    {
    	 
    	        switch (item.getItemId())
    	        {
    	        case R.id.menu_add:
    	         
    	            Toast.makeText(ProjectActivity.this, "Add", Toast.LENGTH_SHORT).show();
    	            return true;
    	 
    	        case R.id.menu_search:
       	         
    	            Toast.makeText(ProjectActivity.this, "Search", Toast.LENGTH_SHORT).show();
    	            return true;
	 
    	        case R.id.menu_delete:
          	         
    	            Toast.makeText(ProjectActivity.this, "Delete", Toast.LENGTH_SHORT).show();
    	            return true;
     
    	        case R.id.menu_setting:      	         
    	            Toast.makeText(ProjectActivity.this, "Setting", Toast.LENGTH_SHORT).show();
    	            return true;  	 
    	        default:
   	            return super.onOptionsItemSelected(item);
   	        }
    	    }    

}